import Vue from 'vue'
import Vuex from 'vuex'
// modules
import system from './modules/system'
import provideEnd from './modules/provideEnd'
import manageEnd from './modules/manageEnd'

Vue.use(Vuex)

const options = {
  modules: {
    system,
    provideEnd,
    manageEnd,
  },
  getters: {
    userAuthority: (state) => state.system.userAuthority,

    themeList: (state) => state.system.themeList,
    productList: (state) => state.system.productList,
    fieldList: (state) => state.system.fieldList,
    organList: (state) => state.system.organList,
    roleList: (state) => state.system.roleList,
  },
}

const store = new Vuex.Store(options)

export default store
